package cn.fjy.android.phone.worker;

import android.media.AudioManager;
import android.media.ToneGenerator;

/**
 * 提示音定时任务
 * 
 * @author GrayF
 * 
 */
class AudioTTRemind implements Runnable {

	private int tone_type = 12;

	private int tone_sed = 200;

	private boolean isEnable = true;

	public void setEnable(boolean isEnable) {
		this.isEnable = isEnable;
	}

	@Override
	public void run() {
		while (true) {
			try {
				Thread.sleep(45000);
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
			if (isEnable) {
				ToneGenerator mToneGenerator = new ToneGenerator(
						AudioManager.STREAM_MUSIC, 80);
				mToneGenerator.startTone(tone_type, tone_sed);
				mToneGenerator.startTone(tone_type, tone_sed);
			} else {
				break;
			}
		}
	}

}